import { ref, reactive, computed } from "vue";
import { defineStore } from "pinia";

export const usephyorganStore = defineStore("add_form", () => {
  // 添加机构里面的填、选的值(来自添加机构的组件)
  let addform = reactive({
    organName: "",
    provinceId: null, //选择的省名
    cityId: null, //选择的市名
    name: "", //分支名称
    type: null, //机构类型
    status: null, //机构属性
    isUsed: 1, //是否启用
    phone: "", //电话
    location: "", //地址
    north: "", //北纬
    east: "", //东经
    imgUrl: "", //图片路径
  });
  // 修改机构里面的填、选的值(来自修改机构的组件)
  let updateform = reactive({
    organName: "",
    provinceId: null, //选择的省名
    cityId: null, //选择的市名
    name: "", //分支名称
    type: null, //机构类型
    status: null, //机构属性
    isUsed: 1, //是否启用
    phone: "", //电话
    location: "", //地址
    north: "", //北纬
    east: "", //东经
    imgUrl: "", //图片路径
  });
  function up_addform(form: {}) {
    Object.assign(addform, form);
  }
  function update_form(form: {}) {
    Object.assign(updateform, form);
  }
  //   const doubleCount = computed(() => count.value * 2);

  return { addform, up_addform, updateform, update_form };
});
